<?php session_start(); ?>

<html xmlns="http://www.w3.org/1999/xhtml">
<?php
include "config/identitas-situs.php";
include "config/koneksi.php";
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>
Hubungi Kami &laquo; <?php echo $title; ?>
</title>
<link rel="shortcut icon" href="images/icon.ico" />
<link href="config/style.css" type="text/css" rel="stylesheet" />

</head>
<body>
 <div id="lebar-web">
	<div id="header">
		<div class="header-judul"><?php echo $namasitus; ?></div>
		<div class="header-deskripsi"><?php echo $deskripsi; ?></div>
	</div>
	<ul id="menu_nav" class="Blue">
		<li class="button"><a href="index.php">Beranda</a></li>
		<li class="button"><a href="berita.php">Informasi PPDB</a></li>
		<li class="button"><a href="profil.php">Profil Sekolah</a></li>
		<li class="button"><a href="daftar.php">Pendaftaran</a></li>
        <li class="button"><a href="jurusan.php">Program Keahlian</a></li>
		
        <li class="button"><a href="login.php">Masuk</a></li>		
	 </ul>
  <div id="isi">

<?php
include "config/koneksi.php";
if(isset($_POST['nama']))
{
	if($_POST['nama']=="" or $_POST['email']=="" or $_POST['pesan']=="" or $_POST['kode']==""){
		echo "<script>alert('silahkan isi kolom yang kosong dulu..!');location.href='pesan.php';</script>";
		exit();
	
		}
	else {
	if($_POST['kode']==$_SESSION['captcha_session'])
	{
			
	
	mysql_query("INSERT INTO pesan SET nama='$_POST[nama]', email='$_POST[email]', pesan='$_POST[pesan]' ");
	echo "<script>alert('Pesan anda telah terkirim. Terima Kasih.');location.href='index.php';</script>";
	exit();
	}  else { echo "Kode yang Anda masukkan tidak cocok<br />
			      <a href=javascript:history.go(-1)><b>Ulangi Lagi</b></a>";
		}}
}
else {
	unset($_POST['nama']);
}
?>
<fieldset style="border:1px solid #0099FF">
<legend style="font-weight:bold; color:#0066CC">Isi pesan </legend>
Silahkan isi pesan atau komentar anda dibawah ini, untuk saran dan kritik demi kualitas pelayanan kursus kami <br />
<form method="post" action="<?php $_SERVER['PHP_SELF']; ?>" >
<table id="belang">
 <tr>
   <td width="12%">Nama</td>
   <td width="3%">:</td>
   <td width="85%"><input name="nama" type="text" id="nama" /></td>
 </tr>
 <tr>
   <td>Email</td>
   <td>:</td>
   <td><input name="email" type="text" id="email" size="30" /></td>
 </tr>
 <tr>
   <td>Pesan</td>
   <td>:</td>
   <td><textarea name="pesan" id="pesan" maxlength="100"></textarea></td>
 </tr>
 <tr><td  colspan="2">&nbsp;</td><td><img src="captcha.php"></td></tr>
 <tr><td colspan="2">&nbsp;</td><td>(Masukkan 6 kode diatas)<br /><input type=text name=kode size=6 maxlength=6><br /></td></tr>
 <tr>
   <td>&nbsp;</td><td>:</td>
   <td><input type="submit" name="Submit" value="Kirim" /></td>
 </tr>
 
</table>
</form>
</fieldset>
  </div>
 	<div style="clear:both" />
 	<div id="footer"align="center"><?php echo $namasitus; ?> <br><br> &copy; 2014 copyright by: <a href="author.php">Lulu Infajaroh</a>
	<a href="#header" title="Kembali ke Atas"><img src="images/go-top.png" style="float:right; width:15px; height:15px;" /></a></div>
 </div>
</body>
</html>
